<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>test</title>
<script>
function log(message){                    
	var console = document.getElementById("debuginfo");
	if (console === null){
		console = document.createElement("div");
		console.id = "debuginfo";
		console.style.background = "#dedede";
		console.style.border = "1px solid silver";
		console.style.padding = "5px";
		console.style.width = "400px";
		console.style.position = "absolute";
		console.style.right = "0px";
		console.style.top = "0px";
		document.body.appendChild(console);
	}
	console.innerHTML += "<p>" + message + "</p>";
}
function sum(num1, num2){
	log("参数值分别为：" + num1 + "、" + num2);
	log("计算参数的和为：");
	var result = num1 + num2;
	log(result);
	return result;
}
window.onload =function(){
	sum(24, 45);
}



</script>
</head>
<body>
</body>
</html> 



